import { defineStore } from "pinia";
export const useStore = defineStore("storeId", {
    state: () => {
        return {
            loadingCount: 0,
            isloading: false,
            router: [],
            hasrouter: false,
            fileName: '', //补充材料下载的文件名
            buttonPermission: []
        };
    },
    getters: {},
    actions: {
        addloadingcount() {
            this.loadingCount+=1;
        },
        subtractloadingcount() {
            this.loadingCount-=1;
        },
        openloading() {
            this.isloading = true;
        },
        closeloading() {
            this.isloading = false;
        },
        addrouter(val: any) {
            this.router = val;
            this.hasrouter = true;
        },
        delrouter() {
            this.router = [];
            this.hasrouter = false;
        },
        setFileName(name: string) {
            this.fileName = name
        },
        setButtonPremission(list: any) {
            this.buttonPermission = list
        }
    },
    // persist: {
    //     enabled: true,
    //     strategies: [
    //         {
    //             key: "my_user",
    //             storage: localStorage,
    //         },
    //     ],
    // },
});
